package org.itzixi.controller;

import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;

import lombok.extern.slf4j.Slf4j;
import org.itzixi.tasks.SMSTask;
import org.itzixi.utils.IPUtil;
import org.itzixi.utils.MyInfo;
import org.itzixi.utils.SMSUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.itzixi.base.BaseInfoProperties.MOBILE_SMSCODE;

@RestController
@RequestMapping("a")
@Slf4j
public class HelloController {

    @Resource
    private SMSUtils smsUtils;

    @Resource
    private SMSTask smsTask;
    @GetMapping("hello")
    public Object hello(){
        return "hello world88";
    }

    @GetMapping("sms")
    public Object sms() throws Exception{
        smsUtils.sendSMS(MyInfo.getMobile(),"1234");
        return "send sms success";
    }

    @GetMapping("smsTask")
    public Object smsTask() throws Exception{
        smsTask.sendSMSInTask(MyInfo.getMobile(),"8111");
        return "send sms in task success";
    }
}
